home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 4 #11 / Commodore_Disk_User_Vol.4_11_1991_-.d64 / bud review (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  10KB  |  318 lines

  1. 100 goto380
  2. 110 open2,8,2,"0:budget data 2,s,r"
  3. 120 forty=1to192
  4. 130 input#2,y$(ty)
  5. 140 input#2,y(ty)
  6. 150 nextty
  7. 160 forty=1to192
  8. 170 input#2,h$(ty)
  9. 180 input#2,h(ty)
  10. 190 nextty
  11. 200 input#2,gt$
  12. 210 forty=1to12
  13. 220 input#2,ym$(ty)
  14. 230 input#2,ym(ty)
  15. 240 nextty
  16. 250 forty=1to12
  17. 260 input#2,hm$(ty)
  18. 270 input#2,hm(ty)
  19. 280 nextty
  20. 290 forty=1to16
  21. 300 input#2,ys$(ty)
  22. 310 input#2,ys(ty)
  23. 320 nextty
  24. 330 forty=1to16
  25. 340 input#2,hs$(ty)
  26. 350 input#2,hs(ty)
  27. 360 nextty:close2
  28. 370 return
  29. 380 ifam$=mid$(mt$(1),2,3)andam=0then400
  30. 390 gosub110:goto520
  31. 400 forp=1to16:ys$(p)="0000":nextp
  32. 410 forp=1to12:ym$(p)="0000":nextp
  33. 420 forer=1to(12*16):ify$(er)="000"theny$(er)="---":nexter
  34. 430 forty=1to16
  35. 440 sr$(ty)=ss(ty):sr$(ty)=ss$(ty)
  36. 450 ss$(ty)=su(ty):ss$(ty)=su$(ty)
  37. 460 su$(ty)=st(ty):su$(ty)=st$(ty)
  38. 470 nextty:forty=1to12
  39. 480 ba(ty)=bb(ty):ba$(ty)=bb$(ty)
  40. 490 bb(ty)=bc(ty):bb$(ty)=bc$(ty)
  41. 500 bc(ty)=mt(ty):bc$(ty)=mt$(ty)
  42. 510 nextty:am$="+"
  43. 520 la$="":lb$=" ":lc$="  ":ld$="   ":le$="    "
  44. 530 lf$="[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":lk$=""
  45. 540 forty=1to16:st$(ty)=ys$(ty):nextty
  46. 550 forty=1to12:mt$(ty)=ym$(ty):nextty
  47. 560 iffr=1thenlo=1:load"budget calc",8,1
  48. 570 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  49. 580 print"[164][164][164][164]"
  50. 590 print"review subjects.................... f1 [146]"
  51. 600 print"[164][164][164][164]"
  52. 610 print"review months...................... f3 [146]"
  53. 620 print"[164][164][164][164]"
  54. 630 print"review totals graphically.......... f5 [146]"
  55. 640 print"[164][164][164][164]"
  56. 650 print"review profit or loss.............. f7 [146]"
  57. 660 print"[164][164][164][164][164][164][164][164][164][164][164]";
  58. 670 print"return to the spreadsheet.... space bar [146]"
  59. 680 print"what is your option ?"
  60. 690 getqu$:ifqu$=""then690
  61. 700 ifqu$="[133]"orqu$="[134]"orqu$="[135]"orqu$="[136]"orqu$=" "then720
  62. 710 goto690
  63. 720 print"[145]             please wait"
  64. 730 ifqu$="[133]"then790
  65. 740 ifqu$="[134]"then1190
  66. 750 ifqu$="[135]"then1520
  67. 760 ifqu$="[136]"then2810
  68. 770 ifqu$=" "thenlo=1:load"budget calc",8,1
  69. 780 goto690
  70. 790 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  71. 800 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
  72. 810 print""
  73. 820 prints$(1);la$;ba$(1);lc$;bb$(1);lc$;bc$(1);lc$;ys$(1):print
  74. 830 prints$(2);la$;ba$(2);lc$;bb$(2);lc$;bc$(2);lc$;ys$(2):print
  75. 840 prints$(3);la$;ba$(3);lc$;bb$(3);lc$;bc$(3);lc$;ys$(3):print
  76. 850 prints$(4);la$;ba$(4);lc$;bb$(4);lc$;bc$(4);lc$;ys$(4):print
  77. 860 prints$(5);la$;ba$(5);lc$;bb$(5);lc$;bc$(5);lc$;ys$(5):print
  78. 870 prints$(6);la$;ba$(6);lc$;bb$(6);lc$;bc$(6);lc$;ys$(6):print
  79. 880 prints$(7);la$;ba$(7);lc$;bb$(7);lc$;bc$(7);lc$;ys$(7):print
  80. 890 prints$(8);la$;ba$(8);lc$;bb$(8);lc$;bc$(8);lc$;ys$(8):print
  81. 900 print"  use joystick to view other subjects"
  82. 910 print""
  83. 920 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  84. 930 if(sdand1)then920
  85. 940 if(sdand2)then990
  86. 950 if(sdand4)then920
  87. 960 if(sdand8)then920
  88. 970 iffo=0then570
  89. 980 sd=0:goto920
  90. 990 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  91. 1000 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
  92. 1010 print""
  93. 1020 prints$(9);la$;ba$(9);lc$;bb$(9);lc$;bc$(9);lc$;ys$(9):print
  94. 1030 prints$(10);la$;ba$(10);lc$;bb$(10);lc$;bc$(10);lc$;ys$(10):print
  95. 1040 prints$(11);la$;ba$(11);lc$;bb$(11);lc$;bc$(11);lc$;ys$(11):print
  96. 1050 prints$(12);la$;ba$(12);lc$;bb$(12);lc$;bc$(12);lc$;ys$(12):print
  97. 1060 prints$(13);la$;ba$(13);lc$;bb$(13);lc$;bc$(13);lc$;ys$(13):print
  98. 1070 prints$(14);la$;ba$(14);lc$;bb$(14);lc$;bc$(14);lc$;ys$(14):print
  99. 1080 prints$(15);la$;ba$(15);lc$;bb$(15);lc$;bc$(15);lc$;ys$(15):print
  100. 1090 prints$(16);la$;ba$(16);lc$;bb$(16);lc$;bc$(16);lc$;ys$(16):print
  101. 1100 print"  use joystick to view other subjects"
  102. 1110 print""
  103. 1120 f=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  104. 1130 if(sdand1)then790
  105. 1140 if(sdand2)then1120
  106. 1150 if(sdand4)then1120
  107. 1160 if(sdand8)then1120
  108. 1170 iffo=0then570
  109. 1180 sd=0:goto1120
  110. 1190 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  111. 1200 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
  112. 1210 print""
  113. 1220 printm$(1);"";la$;sr$(1);lc$;ss$(1);lc$;su$(1);lc$;ym$(1)
  114. 1230 print"";m$(2);"";la$;sr$(2);lc$;ss$(2);lc$;su$(2);lc$;ym$(2)
  115. 1240 print"";m$(3);"";la$;sr$(3);lc$;ss$(3);lc$;su$(3);lc$;ym$(3)
  116. 1250 print"";m$(4);"";la$;sr$(4);lc$;ss$(4);lc$;su$(4);lc$;ym$(4)
  117. 1260 print"";m$(5);"";la$;sr$(5);lc$;ss$(5);lc$;su$(5);lc$;ym$(5)
  118. 1270 print"";m$(6);"";la$;sr$(6);lc$;ss$(6);lc$;su$(6);lc$;ym$(6)
  119. 1280 print" use joystick to view following months":forty=1to100:gettu$:nextty
  120. 1290 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  121. 1300 if(sdand1)then1290
  122. 1310 if(sdand2)then1360
  123. 1320 if(sdand4)then1290
  124. 1330 if(sdand8)then1290
  125. 1340 iffo=0then570
  126. 1350 sd=0:goto1290
  127. 1360 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  128. 1370 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3:print""
  129. 1380 print"";m$(7);"";la$;sr$(7);lc$;ss$(7);lc$;su$(7);lc$;ym$(7)
  130. 1390 print"";m$(8);"";la$;sr$(8);lc$;ss$(8);lc$;su$(8);lc$;ym$(8)
  131. 1400 print"";m$(9);"";la$;sr$(9);lc$;ss$(9);lc$;su$(9);lc$;ym$(9)
  132. 1410 print"";m$(10);"";la$;sr$(10);lc$;ss$(10);lc$;su$(10);lc$;ym$(10)
  133. 1420 print"";m$(12);"";la$;sr$(12);lc$;ss$(12);lc$;su$(12);lc$;ym$(12)
  134. 1430 print" use joystick to view following months"
  135. 1440 print"[145][145][145][145][145][145][145]";m$(11);"";la$;sr$(11);lc$;ss$(11);lc$;su$(11);lc$;ym$(11)
  136. 1450 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  137. 1460 if(sdand1)then1190
  138. 1470 if(sdand2)then1450
  139. 1480 if(sdand4)then1450
  140. 1490 if(sdand8)then1450
  141. 1500 iffo=0then570
  142. 1510 sd=0:goto1450
  143. 1520 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  144. 1530 ifgt>4000then2160
  145. 1540 ifgt(1)>4000then2160
  146. 1550 ifgt(2)>4000then2160
  147. 1560 ifgt(3)>4000then2160
  148. 1570 print"";la$;cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
  149. 1580 print"4000 [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164] "
  150. 1590 print"[167]      [221]      [221]      [221]      [165]"
  151. 1600 print"[167]      [221]      [221]      [221]      [165]"
  152. 1610 print"[167]      [221]      [221]      [221]      [165]"
  153. 1620 print"3000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  154. 1630 print"[167]      [221]      [221]      [221]      [165]"
  155. 1640 print"[167]      [221]      [221]      [221]      [165]"
  156. 1650 print"[167]      [221]      [221]      [221]      [165]"
  157. 1660 print"2000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  158. 1670 print"[167]      [221]      [221]      [221]      [165]"
  159. 1680 print"[167]      [221]      [221]      [221]      [165]"
  160. 1690 print"[167]      [221]      [221]      [221]      [165]"
  161. 1700 print"1000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  162. 1710 print"[167]      [221]      [221]      [221]      [165]"
  163. 1720 print"[167]      [221]      [221]      [221]      [165]"
  164. 1730 print"[167]      [221]      [221]      [221]      [165]"
  165. 1740 print"   0[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  166. 1750 gi=1:gh=7:gosub1790
  167. 1760 gi=2:gh=14:gosub1790
  168. 1770 gi=3:gh=21:gosub1790
  169. 1780 gt$=str$(gt):le$=left$(gt$,2):gt$(4)=gt$:gi=4:gh=28:gosub1830:goto2040
  170. 1790 gt(4)=gt
  171. 1800 fora=1to4
  172. 1810 gt$(a)=str$(gt(a))
  173. 1820 nexta
  174. 1830 le$=left$(gt$(gi),2)
  175. 1840 print""tab(gh);
  176. 1850 le=val(le$):ifle=0then1900
  177. 1860 forde=1tole
  178. 1870 print"    [145][157][157][157][157]    [145][157][157][157][157]";
  179. 1880 print"    [145][157][157][157][157]    [145][157][157][157][157]";
  180. 1890 nextde
  181. 1900 le$=mid$(gt$(gi),3,1)
  182. 1910 le=val(le$):ifle=0then1990
  183. 1920 ifle=1thenprint"[146][185][185][185][185]":goto1990
  184. 1930 ifle=2thenprint"[183][183][183][183]":goto1990
  185. 1940 ifle=3thenprint"    [145][157][157][157][157][146][175][175][175][175][146]":goto1990
  186. 1950 ifle=4thenprint"    [145][157][157][157][157][183][183][183][183][146]":goto1990
  187. 1960 ifle=5thenprint"    [145][157][157][157][157]    [146]":goto1990
  188. 1970 ifle=6thenprint"    [145][157][157][157][157]    [146][145][157][157][157][157][146][185][185][185][185]":goto1990
  189. 1980 goto2000
  190. 1990 return
  191. 2000 ifle=7thenprint"    [145][157][157][157][157]    [146][145][157][157][157][157][183][183][183][183]":goto1990
  192. 2010 ifle=8thenprint"    [145][157][157][157][157]    [146][145][157][157][157][157]    [146][145][157][157][157][157][146][185][185][185][185]":goto1990
  193. 2020 ifle=9thenprint"    [145][157][157][157][157]    [146][145][157][157][157][157]    [146][145][157][157][157][157][183][183][183][183]":goto1990
  194. 2030 goto1990
  195. 2040 print"[146]:-  grand totals[146]"
  196. 2050 print"";
  197. 2060 print""gt(1)
  198. 2070 print"";
  199. 2080 print"";gt(2)
  200. 2090 print"";
  201. 2100 print"";gt(3)
  202. 2110 print"";
  203. 2120 print"";gt
  204. 2130 print"        "
  205. 2140 print"":gt$=mid$(gt$,2):gt$=""+gt$
  206. 2150 goto2740
  207. 2160 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  208. 2170 print"";la$;cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
  209. 2180 print"9999 [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164] "
  210. 2190 print"[167]      [221]      [221]      [221]      [165]"
  211. 2200 print"[167]      [221]      [221]      [221]      [165]"
  212. 2210 print"[167]      [221]      [221]      [221]      [165]"
  213. 2220 print"8000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  214. 2230 print"[167]      [221]      [221]      [221]      [165]"
  215. 2240 print"[167]      [221]      [221]      [221]      [165]"
  216. 2250 print"[167]      [221]      [221]      [221]      [165]"
  217. 2260 print"6000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  218. 2270 print"[167]      [221]      [221]      [221]      [165]"
  219. 2280 print"[167]      [221]      [221]      [221]      [165]"
  220. 2290 print"[167]      [221]      [221]      [221]      [165]"
  221. 2300 print"4000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  222. 2310 print"[167]      [221]      [221]      [221]      [165]"
  223. 2320 print"[167]      [221]      [221]      [221]      [165]"
  224. 2330 print"[167]      [221]      [221]      [221]      [165]"
  225. 2340 print"2000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
  226. 2350 print"    [167]      [221]      [221][160]     [221]      [165]"
  227. 2360 print"     [167]      [221]      [221]      [221]      [165]"
  228. 2370 print"     [167]      [221]      [221][160]     [221]      [165]"
  229. 2380 print"    0[167]      [221]      [221]      [221]      [165]"
  230. 2390 gi=1:gh=7:gosub2420:gi=2:gh=14:gosub2420:gi=3:gh=21:gosub2420
  231. 2400 gt$=str$(gt):le$=left$(gt$,2)
  232. 2410 gt$(4)=gt$:gi=4:gh=28:gosub2430:goto2630
  233. 2420 gt(4)=gt:fora=1to4:gt$(a)=str$(gt(a)):nexta
  234. 2430 le$=left$(gt$(gi),2)
  235. 2440 print""tab(gh);
  236. 2450 le=val(le$):ifle=0then2490
  237. 2460 forde=1tole
  238. 2470 print"    [146][145][157][157][157][157]    [146][145][157][157][157][157]";
  239. 2480 nextde
  240. 2490 le$=mid$(gt$(gi),3,1)
  241. 2500 le=val(le$):ifle=0then2580
  242. 2510 ifle=1thenprint"[185][185][185][185]":goto2580
  243. 2520 ifle=2thenprint"[162][162][162][162]":goto2580
  244. 2530 ifle=3thenprint"[184][184][184][184][146]":goto2580
  245. 2540 ifle=4thenprint"[183][183][183][183][146]":goto2580
  246. 2550 ifle=5thenprint"[163][163][163][163][146]":goto2580
  247. 2560 ifle=6thenprint"    [146]":goto2580
  248. 2570 goto2590
  249. 2580 return
  250. 2590 ifle=7thenprint"    [145][157][157][157][157][146][164][164][164][164]":goto2580
  251. 2600 ifle=8thenprint"    [145][157][157][157][157][146][175][175][175][175]":goto2580
  252. 2610 ifle=9thenprint"    [145][157][157][157][157][146][185][185][185][185]":goto2580
  253. 2620 goto2580
  254. 2630 print"[146]:-  grand totals[146]"
  255. 2640 print"";
  256. 2650 print""gt(1)
  257. 2660 print"";
  258. 2670 print"";gt(2)
  259. 2680 print"";
  260. 2690 print"";gt(3)
  261. 2700 print"";
  262. 2710 print"";gt
  263. 2720 print"        "
  264. 2730 print"":gt$=mid$(gt$,2):gt$=""+gt$
  265. 2740 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
  266. 2750 if(sdand1)then2740
  267. 2760 if(sdand2)then2740
  268. 2770 if(sdand4)then2740
  269. 2780 if(sdand8)then2740
  270. 2790 iffo=0then570
  271. 2800 sd=0:goto2740
  272. 2810 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
  273. 2820 forui=1to12:a$=left$(m$(ui),2)
  274. 2830 printtab(11+ui);a$;:nextui:print"    ";
  275. 2840 foraf=1to16:prints$(af);"[207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][208] [207][208]":nextaf
  276. 2850 printtab(12)"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183] [183][183]"
  277. 2860 printtab(12);"[207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][208] [207][208]"
  278. 2870 printtab(12)"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183] [183][183]"
  279. 2880 print" [146][158]=loss  (actual is more than estimated)"
  280. 2890 print" [146][158]=profit(actual is less than estimated)"
  281. 2900 forw=1to192
  282. 2910 v(w)=h(w)-y(w):ifv(w)>0thenv(w)=1:goto2940
  283. 2920 ifv(w)<0thenv(w)=-1:goto2940
  284. 2930 ifv(w)=0thenv(w)=0:goto2940
  285. 2940 nextw:sc=10:mp=0:print"";:goto3030
  286. 2950 forer=1to12
  287. 2960 mp=mp+1:ifv(mp)=1then2990
  288. 2970 ifv(mp)=-1then3000
  289. 2980 ifv(mp)=0then3010
  290. 2990 printtab(sc+(er*2))"  [146][158]";:goto3020
  291. 3000 printtab(sc+(er*2))"  [146][158]";:goto3020
  292. 3010 printtab(sc+(er*2))"[146][158]";
  293. 3020 nexter:return
  294. 3030 forzz=1to16:print"":gosub2950:nextzz
  295. 3040 mp=0:print""
  296. 3050 mp=mp+1:ifmp=17then3120
  297. 3060 io=hs(mp)-ys(mp):ifio>0thenio=1:goto3110
  298. 3070 ifio<0thenio=-1:goto3100
  299. 3080 ifio=0thenio=0:goto3090
  300. 3090 printtab(37)"[146]":goto3050
  301. 3100 printtab(37)"  [146]":goto3050
  302. 3110 printtab(37)"  [146]":goto3050
  303. 3120 mp=0:print""
  304. 3130 mp=mp+1:ifmp=13then3200
  305. 3140 io=hm(mp)-ym(mp):ifio>0thenio=1:goto3190
  306. 3150 ifio<0thenio=-1:goto3180
  307. 3160 ifio=0thenio=0:goto3170
  308. 3170 printtab(10+(mp*2))"[146]";:goto3130
  309. 3180 printtab(10+(mp*2))"  [146]";:goto3130
  310. 3190 printtab(10+(mp*2))"  [146]";:goto3130
  311. 3200 print""
  312. 3210 ifgh=gtthenprinttab(37)"[146]":goto3240
  313. 3220 ifgh>gtthenprinttab(37)"  [146]":goto3240
  314. 3230 ifgh<gtthenprinttab(37)"  [146]":goto3240
  315. 3240 print"[158]";:fo=peek(56320)and16
  316. 3250 iffo=0then570
  317. 3260 goto3240
  318.